{*
# $Id: message.fs 112 2010-04-20 06:50:55Z Administrator $
# $Revision: 112 $
# $Author: Administrator $
# $Date: 2010-04-20 06:50:55 +0000 (Tue, 20 Apr 2010) $
*}{if $smarty.session.wml==1}
	{*WML START*}
	<p>{$msg}</p>
	<p>
	{foreach from=$button item="btn"}
	{if $btn.url}
	<a href="{$btn.url}">{$btn.value|default:'Continue...'}</a> 
	{/if}
	{if $btn.url=='' or $btn.action=='history.go(-1)' or $btn.action=='history.back(1)'}
		<anchor>{$btn.value|default:'Continue...'}
			<prev/>
		</anchor>
	{/if}
	{/foreach}
	</p>
{else}{*WEB START*}
{if $msgtype!=2}
{include file=$smarty.const.__FASTTPL__|cat:"head.fs"}
	<table width="100%" height="100%"><tr><td align="center">
{/if}
		<div class="message">
			<div class="caption">{$caption}</div>
			<div class="text">{$msg}
			<div style="text-align: center; ">
			{if $msgtype==0}
			{foreach from=$button item="btn"}
			<a name="msgbtn" {if $btn.action}href="javascript:;" onclick="{$btn.action}"{elseif $btn.url}href="{$btn.url}"{else}href="javascript:;" onclick="history.go(-1)"{/if} {if $btn.key} accesskey="{$btn.key}"{/if}>{$btn.value|default:'Continue...'}{if $btn.key}({$btn.key|upper}){/if}</a>	
			{/foreach}
			{elseif $msgtype==1}
			{foreach from=$button item="btn"}
			<input type="button" name="msgbtn"
			onclick="javascript:{if $btn.url}window.location='{$btn.url}'{elseif $btn.action}{$btn.action}{else}history.go(-1){/if};"
			value="{$btn.value|default:'Continue...'}{if $btn.key}({$btn.key|upper}) "
			accesskey="{$btn.key}{/if}" />&nbsp; {/foreach}
			{/if}
			</div>
			</div>
		</div>
{literal}
<script type="text/javascript">
//<![CDATA[
	msg={};
	msg.info={
		btn:document.getElementsByName("msgbtn"),
		{/literal}
		defbtn:{$defbtn},
		btnTime:parseInt("{$auto_time}"),
		btnClick:parseInt("{$auto_time}"),
		{literal}
		btnValue:null};
	msg.run=function()
	{
		if((this.info.btnValue==null) && (this.info.defbtn>0 && this.info.defbtn<this.info.btn.length+1))
		{
			if(this.info.btn[this.info.defbtn-1].tagName== 'INPUT'){
				this.info.btntag='BUTTON';
			}
			if(this.info.btntag=='BUTTON'){
				this.info.btnValue=this.info.btn[this.info.defbtn-1].value;
			}else{
				this.info.btnValue=this.info.btn[this.info.defbtn-1].innerHTML;
			}
		}
		if(this.info.btnTime && (this.info.defbtn>0 && this.info.defbtn<this.info.btn.length+1))
		{
			if(this.info.btntag=='BUTTON'){
				this.info.btn[this.info.defbtn-1].value=this.info.btnValue+"  ["+this.info.btnTime+"s]";
			}else{
				this.info.btn[this.info.defbtn-1].innerHTML=this.info.btnValue+"  ["+this.info.btnTime+"s]";
			}
			this.info.btnTime--;
			setTimeout("msg.run()",1000);

		}
		else if(this.info.defbtn>0 && this.info.defbtn<this.info.btn.length+1)
		{
			if(this.info.btntag=='BUTTON'){
				this.info.btn[this.info.defbtn-1].select();
				this.info.btnClick && this.info.btn[this.info.defbtn-1].onclick();
			}else{
				if(this.info.btnClick){
					if(this.info.btn[this.info.defbtn-1].onclick){
						this.info.btn[this.info.defbtn-1].onclick();
					}else{
						window.location=this.info.btn[this.info.defbtn-1].getAttribute('href');
					}
				}
			}
			
		}
	}
//]]>
</script>{/literal}{if $msgtype!=2}{literal}
<script type="text/javascript">
//<![CDATA[
	jsLoad=window.onload?window.onload:function(){};
	window.onload=function()
	{
		jsLoad();
		msg.run();
	}
//-->
</script></td></tr></table>
{/literal}
{include file=$smarty.const.__FASTTPL__|cat:"foot.fs"}
{/if}	
{/if}